package com.itmuch.cms.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.itmuch.cms.admin.domain.Admin;
import com.itmuch.cms.admin.service.IAdminService;
import com.itmuch.core.page.PageInfo;
import com.itmuch.core.page.PageVo4BsGrid;

@Controller
@RequestMapping("${adminPath}/admin")
public class AdminController {
    @Resource
    private IAdminService adminService;

    @RequestMapping("")
    public String index() {
        return "admin/admin/admin";
    }

    /**
     * 分页列表所有
     * @param vo
     * @return
     */
    @RequestMapping("/get-paged")
    @ResponseBody
    public PageInfo<Admin> selectPaged(PageVo4BsGrid vo) {
        return this.adminService.selectPaged(vo);
    }

    @RequestMapping("/add")
    public String add() {
        return "admin/admin/admin_add";
    }

    @RequestMapping("/edit-by-id")
    public String edit() {
        return "admin/admin/admin_edit";
    }

}
